home *** CD-ROM | disk | FTP | other *** search
- Path: atglab.bls.com!Alun.Champion
- From: Alun.Champion@bridge.bst.bls.com (Alun Champion)
- Newsgroups: comp.lang.c++
- Subject: Re: overloading []
- Date: 16 Jan 1996 19:39:55 GMT
- Organization: Computer People Inc.
- Message-ID: <ALUN.CHAMPION.96Jan16143955@g7240065.bridge.bst.bls.com>
- References: <4dgjbl$6i3@news1.goodnet.com>
- NNTP-Posting-Host: bstfirewall.bst.bls.com
- In-reply-to: geoff@goodguy's message of 16 Jan 1996 16:22:13 GMT
-
- In article <4dgjbl$6i3@news1.goodnet.com> geoff@goodguy (GEOFF CADIEN) writes:
- : [snip]
- : my problem is this. Given,
-
- : foo *f;
-
- : f = new foo;
-
- : Now the only way I can use the subscript operator is to call it like this
-
- : f->operator[](1) = 10;
-
- : Is this the only way?
-
- No:
-
- (*f)[1] = 10;
-
- or
-
- foo& a = *f;
- a[1] = 10;
-
- Regards
-
- -A.
- --
- | A.Champion |
-